﻿using Newtonsoft.Json;
using System;
using YunZuan.Models.Attributes;
using YunZuan.Models.Entities;

namespace YunZuan.Models
{
    [Table(TableName = "yz_wechat_common", PrimaryKey = "openid")]
    public partial class WechatXcxInfo : BaseEntity
    {
        #region Model
        private int _id;
        /// <summary>
        /// ID
        /// </summary>
        [Column(IsAutoIncrement = true)]
        public int id
        {
            get { return _id; }
            set { this.ChangeNotify<int>("id", value, ref _id); }
        }
        private string _openid;
        /// <summary>
        ///用户的标识，对当前公众号唯一
        /// </summary>
        
        public string openid
        {
            get { return _openid; }
            set { this.ChangeNotify<string>("openid", value, ref _openid); }
        }
        private string _nickname;
        /// <summary>
        ///昵称
        /// </summary>
        public string nickname
        {
            get { return _nickname; }
            set { this.ChangeNotify<string>("nickname", value, ref _nickname); }
        }
        private string _language;
        /// <summary>
        ///用户的语言，简体中文为zh_CN
        /// </summary>
        public string language
        {
            get { return _language; }
            set { this.ChangeNotify<string>("language", value, ref _language); }
        }
        private string _city;
        /// <summary>
        ///用户所在城市
        /// </summary>
        public string city
        {
            get { return _city; }
            set { this.ChangeNotify<string>("city", value, ref _city); }
        }
        private string _province;
        /// <summary>
        ///用户所在省份
        /// </summary>
        public string province
        {
            get { return _province; }
            set { this.ChangeNotify<string>("province", value, ref _province); }
        }
        private string _country;
        /// <summary>
        ///用户所在国家
        /// </summary>
        public string country
        {
            get { return _country; }
            set { this.ChangeNotify<string>("country", value, ref _country); }
        }
        private string _headimgurl;
        /// <summary>
        ///公众号用户头像
        /// </summary>
        public string headimgurl
        {
            get { return _headimgurl; }
            set { this.ChangeNotify<string>("headimgurl", value, ref _headimgurl); }
        }
        private string _subscribe_time;
        /// <summary>
        ///用户关注时间，为时间戳。如果用户曾多次关注，则取最后关注时间
        /// </summary>
        public string subscribe_time
        {
            get { return _subscribe_time; }
            set { this.ChangeNotify<string>("subscribe_time", value, ref _subscribe_time); }
        }
        private string _unionid;
        /// <summary>
        ///只有在用户将公众号绑定到微信开放平台帐号后，才会出现该字段。
        /// </summary>
        public string unionid
        {
            get { return _unionid; }
            set { this.ChangeNotify<string>("unionid", value, ref _unionid); }
        }
        private string _remark;
        /// <summary>
        ///公众号运营者对粉丝的备注，公众号运营者可在微信公众平台用户管理界面对粉丝添加备注
        /// </summary>
        public string remark
        {
            get { return _remark; }
            set { this.ChangeNotify<string>("remark", value, ref _remark); }
        }
        private int _groupid;
        /// <summary>
        ///用户所在的分组ID（兼容旧的用户分组接口）
        /// </summary>
        public int groupid
        {
            get { return _groupid; }
            set { this.ChangeNotify<int>("groupid", value, ref _groupid); }
        }
        private string _tagidlist;
        /// <summary>
        ///用户被打上的标签ID列表
        /// </summary>
        public string tagidlist
        {
            get { return _tagidlist; }
            set { this.ChangeNotify<string>("tagidlist", value, ref _tagidlist); }
        }
        private int _sex;
        /// <summary>
        ///微信公众号性别
        /// </summary>
        public int sex
        {
            get { return _sex; }
            set { this.ChangeNotify<int>("sex", value, ref _sex); }
        }

        /// <summary>
        ///用户特权信息，json数组，如微信沃卡用户为（chinaunicom）
        /// </summary>
        public string[] privilege { get; set; }

        private string _privilegeJson;
        /// <summary>
        ///用户特权信息，json数组，如微信沃卡用户为（chinaunicom）
        /// </summary>
        public string privilegeJson
        {
            get { _privilegeJson = JsonConvert.SerializeObject(privilege); return _privilegeJson; }
            set { this.ChangeNotify<string>("privilegeJson", value, ref _privilegeJson); }
        }


        /// <summary>
        /// //扫码或公众号用户 对应1或2  ####### 自定义，非接口返回,用于微信用户区别###########
        /// </summary>
        private int _user_type;
        public int user_type
        {
            get { return _user_type; }
            set { this.ChangeNotify<int>("user_type", value, ref _user_type); }
        }

        /// <summary>
        /// 小程序性别
        /// </summary>
        private int _gander;
        public int gender
        {
            get { return _gander; }
            set { this.ChangeNotify<int>("sex", value, ref _gander); }
        }

        /// <summary>
        /// 小程序头像
        /// </summary>
        private string _avatarUrl;
        /// <summary>
        ///用户头像
        /// </summary>
        public string avatarUrl
        {
            get { return _avatarUrl; }
            set { this.ChangeNotify<string>("headimgurl", value, ref _avatarUrl); }
        }
        /// <summary>
        /// create_time
        /// </summary>
        private DateTime _create_time;
        /// <summary>
        ///用户头像
        /// </summary>
        public DateTime create_time
        {
            get { return _create_time; }
            set { this.ChangeNotify<DateTime>("create_time", value, ref _create_time); }
        }
        /// <summary>
        /// create_time
        /// </summary>
        private DateTime _bind_time;
        /// <summary>
        ///用户头像
        /// </summary>
        public DateTime bind_time
        {
            get { return _bind_time; }
            set { this.ChangeNotify<DateTime>("bind_time", value, ref _bind_time); }
        }
        /// <summary>
        /// 先加客户id，如果团队也要绑定另外再说
        /// </summary>
        private int _customerId;
        /// <summary>
        ///用户头像
        /// </summary>
        public int customer_id
        {
            get { return _customerId; }
            set { this.ChangeNotify<int>("customer_id", value, ref _customerId); }
        }
        /// <summary>
        /// 麦金麦钻需要绑定团队了
        /// </summary>
        private int _flag;
        /// <summary>
        /// 麦金麦钻需要绑定团队了 flag1为客户，2为团队
        /// </summary>
        public int flag
        {
            get { return _flag; }
            set { this.ChangeNotify<int>("flag", value, ref _flag); }
        }
        #endregion



    }
}
